From: Ivan Molodetskikh Date: Mon, 16 Aug 2021 07:29:26 +0000 (+0300) Subject: screenshot-ui: Add IconLabelButton X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~222 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7245f95165db8f5263211619ef7c783aebe559d9;p=gnome-shell.git screenshot-ui: Add IconLabelButton A button that has an icon and a subtitle label. Part-of: --- diff --git a/data/theme/gnome-shell-sass/widgets/_screenshot.scss b/data/theme/gnome-shell-sass/widgets/_screenshot.scss index aa1a11a8c..5c98fce29 100644 --- a/data/theme/gnome-shell-sass/widgets/_screenshot.scss +++ b/data/theme/gnome-shell-sass/widgets/_screenshot.scss @@ -1,4 +1,13 @@ // Screenshot UI +.icon-label-button-container { + spacing: $base_spacing; + font-size: $base_font_size - 3pt; + + StIcon { + icon-size: 32px; + } +} + .screenshot-ui-panel { background-color: $osd_bg_color; border-radius: 12px + 21px; diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 548df498e..17e61531e 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -20,6 +20,25 @@ const { DBusSenderChecker } = imports.misc.util; const ScreenshotIface = loadInterfaceXML('org.gnome.Shell.Screenshot'); +var IconLabelButton = GObject.registerClass( +class IconLabelButton extends St.Button { + _init(iconName, label, params) { + super._init(params); + + this._container = new St.BoxLayout({ + vertical: true, + style_class: 'icon-label-button-container', + }); + this.set_child(this._container); + + this._container.add_child(new St.Icon({ icon_name: iconName })); + this._container.add_child(new St.Label({ + text: label, + x_align: Clutter.ActorAlign.CENTER, + })); + } +}); + var ScreenshotUI = GObject.registerClass( class ScreenshotUI extends St.Widget { _init() {